

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<title>青鸟租房 - 用户登录</title>
<link type="text/css" rel="stylesheet" href="css/style.css" />
<script type="text/javascript" src="js/function.js"></script>
	<script src="js/vue.min.js"></script>
	<script src="js/axios.min.js"></script>
	<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
	<!-- 引入组件库 -->
	<script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<body>
	<div id="app">
		<div id="header" class="wrap">
			<div id="logo">
				<img src="images/logo.gif" />
			</div>
		</div>
		<div id="regLogin" class="wrap">
			<div class="dialog">
				<div class="box">
					<h4>用户登录</h4>
					<form id="User_login_action" name="User_login_action">
						<div class="infos">
							<table class="field">
								<tr>
									<td  colspan="2" style="text-align:center; color:red"></td>
								</tr>
								<tr>
									<td class="field">用 户 名：</td>
									<td>
										<input   v-model="username" type="text" name="username" value="" id="User_login_action_username" class="text" required="true"/>
									</td>
								</tr>
								<tr>
									<td class="field">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：</td>
									<td>
										<input v-model="password" type="password" name="password" id="User_login_action_password" class="text" required="true"/>
									</td>
								</tr>
								<!-- <tr>
                                    <td class="field">验 证 码：</td>
                                    <td><input type="text" class="text verycode" name="veryCode" /></td>
                                </tr> -->
							</table>
							<div class="buttons">
								<el-row>
									<el-button type="primary" @click="login">立刻登录</el-button>
									<el-button type="primary">退出</el-button>
								</el-row>
							</div>


						</div>
					</form>
				</div>
			</div>
		</div>
		<div id="footer" class="wrap">
			<dl>
				<dt>青鸟租房 &copy; 2015 源辰信息科技有限公司  湘ICP证1000001号</dt>
				<dd>关于我们 · 联系方式 · 意见反馈 · 帮助中心</dd>
			</dl>
		</div>
	</div>

<script>
	var v =new Vue({
		el:'#app',
		data:{
			username:'',
			password:'',
		},
		methods:{
			login(){
				axios.get("yc112plyqnzf/users/login",{
					params: {
						username:this.username,
						password:this.password
					}
				}).then(res=>{
					if(res.data.code){
						this.$message(res.data.msg);
						location.href="index.html?";
					}else{
						this.$alert(res.data.msg);
					}
				})
			}
		}
	})
</script>



</body>
</html>


